package com.lyandwc.lw_bbs.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.sql.Timestamp;
import java.util.List;

@Data
@TableName("comment")
public class Comment {
    @JSONField()
    Integer id;
    @JSONField(ordinal = 1)
    String content;
    @JSONField(ordinal = 2, format="yyyy-MM-dd HH:mm:ss")
    Timestamp createAt;
    @JSONField(ordinal = 3)
    int likeCount;
    @JSONField(ordinal = 4)
    int dislikeCount;

    @JSONField(ordinal = 5)
    Integer replyCommentId;
    @JSONField(ordinal = 6)
    Integer userId;
    @JSONField(ordinal = 7)
    Integer topicId;

    @JSONField(ordinal = 8)
    @TableField(exist = false)
    User user;
    @JSONField(ordinal = 9)
    @TableField(exist = false)
    List<Comment> repliedComments;
}
